package com.project.lx.text.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @author: Meteor
 * @description: 类描述
 * @version:
 * @date: 2016/12/29 0029 10:21
 * @company: jijiaxuan.com
 * @email: lx802315@163.com
 */
public class ActMainPagerAdapter extends FragmentPagerAdapter {

    //定一个Fragment数据源
    private List<Fragment> fragments;

    public ActMainPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
